#ifndef __FLDRV_UART_H
#define __FLDRV_UART_H
#include <stdint.h>
#include "at32f425_usart.h"

#define UART1_BAUDRATE	9600
#define UART2_BAUDRATE	9600
#define UART3_BAUDRATE	115200
#define UART4_BAUDRATE	9600

#define UART1_TX_BUF	41	//网络发送长度
#define UART1_RX_BUF	41	//网络接收长度
#define UART2_TX_BUF	20
#define UART2_RX_BUF	20
#define UART4_TX_BUF	4		//空气质量查询
#define UART4_RX_BUF	22

#define UART4_HEAD_NUM1	0x16
#define UART4_HEAD_NUM2	0x13

#define UART1_HEAD			0xAA


typedef enum
{
	UART1_PORT = 1,
	UART2_PORT,
	UART3_PORT,
	UART4_PORT,
}fldrv_uart_port_e;


void fldrv_uart_init(void);

void fldrv_uart1_rx_int(uint8_t rx_data,fldrv_uart_port_e uart_port);
void fldrv_uart_rx_int(uint8_t rx_data,fldrv_uart_port_e uart_port);
void fldrv_uart_send_buf(usart_type* usart_x,uint8_t* data,uint8_t len);

#endif
